import React, { Component } from 'react'
import './index.css'
export default class index extends Component {
  render() {
    const { users, placeholder, isLoading } = this.props
    return (
      users.length === 0 && !isLoading ? <h1>{placeholder}</h1> :
        isLoading ? <h1>搜索中...</h1> :
          <div className="wrap">
            {
              users.map(e => {
                return (
                  <div className="item" key={e.id}>
                    <img src={e.avatar} alt="avatar" />
                    <span>{e.name}</span>
                  </div>
                )
              })
            }
          </div>
    )
  }
}
